import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/components/process/closure_approval_process_widget.dart';
import 'package:enterprise_v6_app/app/core/values/images.dart';
import 'package:enterprise_v6_app/app/modules/application/closure/appointment_review/review/review_details/basic_info.dart';
import 'package:enterprise_v6_app/app/modules/application/closure/appointment_review/review/review_details/review_details_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

/// 预约审核-详情
class ReviewDetailsPage extends StatelessWidget {
  ReviewDetailsPage({super.key});

  final controller = Get.put(ReviewDetailsController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
        init: controller,
        builder: (_) {
          return Scaffold(
            appBar: CustomAppBar(
              titleText: '详情',
            ),
            body: DefaultTabController(
                length: 2,
                child: Column(children: [
                  Container(
                    height: 54.w,
                    decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.circular(8.r),
                    ),
                    child: TabBar(
                      tabs: const [
                        Tab(text: '基本信息'),
                        Tab(text: '审批流程'),
                      ],
                      dividerColor: Colors.transparent,
                      labelPadding: EdgeInsets.only(bottom: 20.w),
                      labelStyle: TextStyle(
                        fontSize: 16.sp,
                        fontWeight: FontWeight.w500,
                      ),
                      unselectedLabelStyle: TextStyle(
                        fontSize: 16.sp,
                        fontWeight: FontWeight.w500,
                      ),
                      labelColor: Colors.black,
                      unselectedLabelColor: const Color(0xffA0A7B5),
                      indicatorPadding: EdgeInsets.only(top: 35.w, bottom: 10.w),
                      indicator: const BoxDecoration(
                        image: DecorationImage(
                          image: AssetImage(
                            AppImages.icon_app_work_plan,
                          ),
                        ),
                      ),
                    ),
                  ),
                  Expanded(
                    child: Container(
                      color: const Color(0xffF5F5F6),
                      child: TabBarView(
                        children: [
                          ReviewBasicInfo(type: controller.type, item: controller.item),
                          ClosureApprovalProcessWidget(nodeList: controller.nodeList, isReject: controller.item.appointmentStatus == 2),
                          // EmergencyCommonWidget.getApprovalProcessWidget(
                          //     processList: [ProcessArrangeRecordEntity(
                          //       approvalDate: '2021-08-12 12:00:00',
                          //       approvalOpinion: '同意',
                          //       approvalPersonnel: '张三',
                          //       nodeName: '预约审核',
                          //     )],
                          // ),
                        ],
                      ),
                    ),
                  ),
                ])),
          );
        });
  }
}
